home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
NEWSOFT
/
AUGUST
/
ARCWEB
/
ReadMeDocs
/
JPEG_Fix
< prev
next >
Wrap
Text File
|
1996-10-17
|
3KB
|
87 lines
JPEG_Fix
========
This file documents how to make changes to ChangeFSI so that it can
recognise and handle "progressive JPEG" images. The instructions are
adapted from my posting on comp.sys.acorn.apps & comp.sys.acorn.misc
in the middle of October 1996.
Contents:
Patching ChangeFSI
Installing the new JPEG software
And Finally ...
Technical Notes
Patching ChangeFSI
==================
Making sure you start with version 1.15 (although it may work for other
versions too), load !ChangeFSI.ChangeFSI into your favourite BASIC editor
(keeping a backup copy!) and make the following changes:
Find the line which says the following (If you search for the string
"JFIF" it's a couple of lines below it)
IFcache%<EXT#c% THEN
Change this to say:
IFcache%<EXT#c% OR FNsnb_needdjpeg(c%) THEN
(DON'T have any trailing spaces on the line or it won't work!)
Add at the end of the program:
DEFFNsnb_next(c%)
LOCALv%:WHILEBGET#c%<>255 AND NOTEOF#c%:ENDWHILE:IFEOF#c%:=&100
REPEAT:v%=BGET#c%:UNTILEOF#c% OR v%<>255:IF EOF#c%:v%=256
=v%
DEFPROCsnb_skip(c%)
LOCALv%,w%:v%=PTR#c%:w%=BGET#c%:w%=(w%*256+BGET#c%)
PTR#c%=v%+w%:ENDPROC
DEFFNsnb_needdjpeg(c%)
LOCALsz%:REM Not Acorn code - added. Assumes file is JPEG!
PTR#c%=2:REPEAT:sz%=FNsnb_next(c%):IFsz%=&C0 OR sz%>255:=FALSE
IFsz%>&C0 ANDsz%<&D0 ANDsz%<>&C4 ANDsz%<>&CC:=TRUE:REM M_SOFn
IFsz%>&E0 AND sz%<&F0:=TRUE: REM M_APPn
PROCsnb_skip(c%):UNTILEOF#c%:=FALSE
Save this, keeping a backup of the original. That completes the
changes to the ChangeFSI program itself. Now you need to install
the new JPEG software.
Installing the new JPEG software
================================
Open the "djpeg" directory which was in the root of the ArcWeb archive
and copy the djpeg program that you find inside to somewhere on Run$Path
so that ChangeFSI can see it. (You may choose to copy it into the
!ChangeFSI directory itself (or !ChangeFSI.djpeg directory)
And Finally ...
===============
That should do it - it now works for me. The following text is a
description of how it works and reading & understanding of it is not
necessary :-)
Technical Notes
===============
This change allows ChangeFSI to spot non-baseline JPEGs and farms that out
to djpeg. Note that even djpeg doesn't handle some of the arithmetic
encodings, but it does allow it to handle images that it otherwise can't.
Note that all my new functions are prefixed "snb_" to avoid name clashes.
Non-JFIF files are trapped here too since anything with a filetype of &C85
is accepted as JPEG. If ChangeFSI is ever extended to supported more SOFn
markers, then these can simply be trapped within the REPEAT loop and
return FALSE for those SOFn types.
--
Stewart Brodie
17th October 1996